/*
 * @Author: xiaoyang
 * @Date: 2021-04-28 14:20:03
 * @LastEditors: xiaoyang
 * @LastEditTime: 2021-04-29 17:29:23
 * @FilePath: \ruoyi-uif:\program_code\move_bzypt\main\js\view-detail.js
 * @description: No description
 */

new Vue({
  el: '#view-details',
  data: {
    tabActive: 0,
    list: [],
  },

  mounted() {
    // 0 等额本息  1 等额本金
    let q_active = getQueryVariable('active');
    let type = getQueryVariable('type');
    let loan = JSON.parse(localStorage.getItem('loan') || null);

    if (type != 3) {
      this.list = loan[q_active].list;
    } else {
      if (this.tabActive === 0) {
        this.list = loan['s'][q_active].list;
      } else {
        this.list = loan['a'][q_active].list;
      }
    }
  },

  methods: {
    /**
     * @description: tab 切换
     * @param {*}
     * @return {*}
     */
    tabChagne(t) {
      let loan = JSON.parse(localStorage.getItem('loan') || null);
      let q_active = getQueryVariable('active');
      if (t === 0) {
        // 商业贷款
        this.list = loan['s'][q_active].list;
      } else {
        // 公积金贷款
        this.list = loan['a'][q_active].list;
      }
    },
  },

  computed: {
    tabShow() {
      return getQueryVariable('type') == 3;
    },
  },
});
